VERSION 5.00
Begin VB.MDIForm MDIForm1 
   BackColor       =   &H8000000C&
   Caption         =   "Jeevan Vaisya Agrotech"
   ClientHeight    =   5580
   ClientLeft      =   3600
   ClientTop       =   3480
   ClientWidth     =   8400
   LinkTopic       =   "MDIForm1"
   WindowState     =   2  'Maximized
   Begin VB.Menu file 
      Caption         =   "&Bond"
      Begin VB.Menu new 
         Caption         =   "&New"
      End
      Begin VB.Menu edit 
         Caption         =   "&Edit"
      End
   End
   Begin VB.Menu customer1 
      Caption         =   "&Renewal"
   End
   Begin VB.Menu empdet 
      Caption         =   "&Employee Details"
      Begin VB.Menu newent 
         Caption         =   "&New Entry"
      End
      Begin VB.Menu editent 
         Caption         =   "&Edit Entry"
      End
   End
   Begin VB.Menu achive1 
      Caption         =   "&Achive"
   End
   Begin VB.Menu salary1 
      Caption         =   "&Salary"
   End
   Begin VB.Menu cheque 
      Caption         =   "Che&que Entry"
   End
   Begin VB.Menu backup 
      Caption         =   "Back&up"
   End
   Begin VB.Menu bulkProcess 
      Caption         =   "Bul&kProcess"
   End
   Begin VB.Menu ExpData 
      Caption         =   "E&xport Data"
   End
   Begin VB.Menu fin1 
      Caption         =   "F&ind"
      Begin VB.Menu fin 
         Caption         =   "Fin&d"
      End
      Begin VB.Menu search 
         Caption         =   "Search"
      End
   End
End
Attribute VB_Name = "MDIForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim intPaintFlag As Integer
 Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 '--------------------------------------------------------------GetUserName--------------------------------------------------------------------
 Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
 '--------------------------------------------------------------GetComputerName-------------------------------------------------------------------
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub achive1_Click()
If jevlogin.Visible = False Then
Unload customer
Unload agentinfo
Unload Jeevan
Load achive
achive.Show
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
Unload ExportData
'Unload sendcheck
End If
End Sub
Private Sub backup_Click()
If jevlogin.Visible = False Then
Unload achive
Unload agentinfo
Unload Jeevan
Unload customer
Unload Salaries
Unload Find
Load BackupFrm
BackupFrm.Show
Unload ChequeFrm
Unload BlkProcess
Unload ExportData
'Unload sendcheck
End If
End Sub

Private Sub bulkProcess_Click()
If jevlogin.Visible = False Then
Unload achive
Unload agentinfo
Unload Jeevan
Unload customer
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload ExportData
Load BlkProcess
BlkProcess.Show
'Unload sendcheck
End If
End Sub

Private Sub cheque_Click()
If jevlogin.Visible = False Then
Unload achive
Unload agentinfo
Unload Jeevan
Unload customer
Unload Salaries
Unload Find
Unload BackupFrm
Load ChequeFrm
Unload ExportData
Unload BlkProcess
ChequeFrm.Show
'Unload sendcheck
End If
End Sub

Private Sub customer1_Click()
If jevlogin.Visible = False Then
Unload achive
Unload agentinfo
Unload Jeevan
Unload ExportData
Load customer
customer.Show
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub
Private Sub edit_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Salaries
Jeevan.Label1.Caption = "Select Reg. No"
Jeevan.txtregno.Visible = False
Jeevan.cbreg.Visible = True
Jeevan.btdelete.Visible = True
Unload ExportData
Load Jeevan
Jeevan.Show
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub
Private Sub editent_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload Jeevan
Unload ExportData
agentinfo.Label21.Visible = True
agentinfo.Combo2.Visible = True
agentinfo.Combo1.Visible = False
agentinfo.Text14.Visible = True
Load agentinfo
agentinfo.Show
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub

Private Sub ExpData_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
Load ExportData
ExportData.Show
'Unload sendcheck
End If
End Sub

Private Sub fin_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Unload Salaries
Unload ExportData
Load Find
Find.Show
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub

'---------------------------------------------------------SysGetComputerName-----------------------------------------------------------
Public Function SysGetComputerName() As String

Dim Computer As String
Dim BufSize As Long
Dim RetCode As Long
Dim NullCharPos As Long

Computer = Space(80)
BufSize = Len(Computer)

'call WINAPI
RetCode = GetComputerName(Computer, BufSize)

'Search for the end of the String
NullCharPos = InStr(Computer, Chr(0))

If NullCharPos > 0 Then
Computer = Left(Computer, NullCharPos - 1)
Else
Computer = ""
End If
SysGetComputerName = Computer
End Function

'--------------------------------------------------------------GetUserNameFunction-----------------------------------------------------------
Private Function sysGetUserName() As String
Dim UserName As String
'Dim BufSize1 As String
Dim RetCode As String
Dim NullCharPos As String

UserName = Space(80)
'BufSize1 = Len(UserName)

RetCode = GetUserName(UserName, Len(UserName))

NullCharPos = InStr(UserName, Chr(0))

If NullCharPos > 0 Then
UserName = Left(UserName, NullCharPos - 1)
Else
UserName = ""
End If
sysGetUserName = UserName
End Function
'-------------------------------------------------------------------------------------------------------------------------------------------------------------


'Private Sub Form_Load()
'Label2 = "User Name " & sysGetUserName
'Label3 = "Computer Name " & SysGetComputerName()
'End Sub
Private Sub Form_Paint() 'splash
If intPaintFlag = 0 Then
intPaintFlag = 1
Form1.Refresh
Sleep 4000
Sleep 4000
If UCase(SysGetComputerName()) <> UCase("system.") Then
End
End If
End If
End Sub
Private Sub MDIForm_Load()
Load jevlogin
jevlogin.Show
'Sleep 1000
'If Now > CDate("01/20/2010") Then End
'If SysGetComputerName() <> UCase("jeevangreen") Then
'MsgBox "YOUR NOT A VALID USER TO USE THIS PROGRAM"
'End
'End If
End Sub

Private Sub MDIForm_Unload(Cancel As Integer)
'Dim FileSystemObject As Object
'Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
'FileSystemObject.DeleteFile "F:\Backup\Jeevan.mdb"
'FileSystemObject.DeleteFile "F:\Backup\PlanA.mdb"
'FileSystemObject.DeleteFile "F:\Backup\PlanC.mdb"
'FileSystemObject.CopyFile App.Path & "\Jeevan.mdb", "F:\Backup\Jeevan.mdb"
'FileSystemObject.CopyFile App.Path & "\PlanA.mdb", "F:\Backup\PlanA.mdb"
'FileSystemObject.CopyFile App.Path & "\PlanC.mdb", "F:\Backup\PlanC.mdb"
End Sub

Private Sub new_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Load Jeevan
Jeevan.txtregno.Visible = True
Jeevan.cbreg.Visible = False
Jeevan.Label1.Caption = "CSS No."
Jeevan.btdelete.Visible = False
Jeevan.Show
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub
Private Sub newent_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload Jeevan
agentinfo.Label21.Visible = False
agentinfo.Combo2.Visible = False
agentinfo.Combo1.Visible = True
agentinfo.Text14.Visible = False
Call agentinfo.resettxt
Load agentinfo
agentinfo.Show
Unload Salaries
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub
Private Sub salary1_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Load Salaries
Salaries.Show
Unload Find
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub

Private Sub search_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Unload Salaries
Unload Find
Load searching
searching.Show
Unload BackupFrm
Unload ChequeFrm
Unload BlkProcess
'Unload sendcheck
End If
End Sub
